package MicroSpring.applicationContext.impl;

import MicroSpring.beanFactory.impl.DefaultListableBeanFactory;
import MicroSpring.beanPostProcessor.impl.*;

/*
    注解配置容器具体实现类.
    本类主要完成 注解类bean后处理器的注册工作
 */
public class AnnotationConfigApplicationContext extends AbstractApplicationContext{


    @Override
    protected void registerBeanPostProcessors(DefaultListableBeanFactory beanFactory) {

        registerConfigurableBeanBeanProcessor(new AutowiredAnnotationBeanPostProcessor(beanFactory));
        registerConfigurableBeanBeanProcessor(new CommonAnnotationBeanPostProcessor(beanFactory));

        if (beanFactory.isOpenAspect()){
            registerConfigurableBeanBeanProcessor(new AnnotationAwareAspectJAutoProxyCreator(beanFactory));
            registerConfigurableBeanBeanProcessor(new AspectBeansInitBeanPostProcessor(beanFactory));
        }

        registerConfigurableBeanBeanProcessor(new LazyInjectBeanPostProcessor(beanFactory));
    }



}
